import App from './App'

import Vue from 'vue'
import './uni.promisify.adaptor'
import navbar from "@/components/navbar"
import nodata from "@/components/nodata"
import { setConfig, interceptorsRequest, interceptorsResponse } from './config'
Vue.prototype.$scss = require("@/uni.scss")
Vue.prototype.$tools = require('@/utils/tools')


import uView from '@/uni_modules/uview-ui'
Vue.use(uView)
// 请求配置
setConfig()

// 拦截器
interceptorsRequest()
interceptorsResponse()

Vue.config.productionTip = false
Vue.component('nodata', nodata)
Vue.component('navbar', navbar)
const msg = (title, duration = 1500, mask = false, icon = 'none') => {
	//统一提示方便全局修改
	if (Boolean(title) === false) {
		return;
	}
	uni.showToast({
		title,
		duration,
		mask,
		icon
	});
}
Vue.prototype.$msg = msg
App.mpType = 'app'
const app = new Vue({
	...App
})
app.$mount()

export function createApp() {
	const app = createSSRApp(App)
	return {
		app
	}
}

